<?php
#    Document   : system_settings
#    Created on : May 15, 2011, 3:11:08 PM
#    Author     : ClarkT AKA FalleN
#    Company    : Amodity
#    Web        : http://www.amodity.com
#    Copyright  : 2011
$this->load->helper('config_file');
?>
<div class="column half fl">
    <div class="box tabs sortable black_box">
        <h2 class="box-header">Settings</h2>

        <ul class="tabs-nav">
            <li class="tab"><a href="#site" class="active"><?php echo $this->lang->line('admin_site') ?></a></li>
            <li class="tab"><a href="#lang"><?php echo $this->lang->line('admin_local') ?></a></li>
            <li class="tab"><a href="#upload"><?php echo $this->lang->line('g_upload') ?></a></li>
            <li class="tab"><a href="#users"><?php echo $this->lang->line('admin_users') ?></a></li>
        </ul>

        <div class="box-content">
            <div id="site">
                <?php
                $site = read_config('config');

                echo form_open('admin/settings');
                echo '<p>';
                echo form_label('Site Directory', 'base_url', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'base_url',
                    'class' => 'form-field width60',
                    'value' => $site['base_url'],
                    'title' => 'Url to your site'
                ));
                echo '</p><p>';
                echo form_label('Index Page', 'index', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'index',
                    'class' => 'form-field width60',
                    'value' => $site['index_page'],
                    'title' => 'index file name removed if using htaccess to clean urls'
                ));
                echo '</p><p>';
                echo form_label('Site Theme', 'theme', array('class' => 'form-label'));
                echo form_dropdown('theme', array($site['theme']), $site['theme']);
                echo '</p>';
                echo form_submit(array('name' => 'site', 'value' => $this->lang->line('g_submit'), 'class' => 'big button themed'));
                ?>
            </div>
            <div id="lang">
                <?php
                $local = read_config('config');

                echo form_open('admin/settings', array('class' => 'form'));
                echo '<p>';
                echo form_label('Language', 'lang', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'lang',
                    'class' => 'form-field width60',
                    'value' => $local['language'],
                    'title' => 'Language you wish your site to use'
                ));
                echo '</p><p>';
                echo form_label('Charset', 'charset', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'charset',
                    'class' => 'form-field width60',
                    'value' => $local['charset'],
                    'title' => 'Charset for your site'
                ));
                echo '</p>';

                echo form_submit(array('name' => 'local', 'value' => $this->lang->line('g_submit'), 'class' => 'big button themed'));
                ?>
            </div>

            <div id="upload">
                <?php
                $upload = read_config('upload');

                echo form_open('admin/settings', array('class' => 'form'));
                echo '<p>';
                echo form_label('Upload Path', 'upload', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'upload',
                    'class' => 'form-field width60',
                    'value' => $upload['upload_path'],
                    'title' => 'Path for images to upload'
                ));
                echo '</p><p>';
                echo form_label('Allowed File Types', 'filetypes', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'filetypes',
                    'class' => 'form-field width60',
                    'value' => $upload['allowed_types'],
                    'title' => 'Sets the allowed uploadible file types seperated by a "|"'
                ));
                echo '</p><p>';
                echo form_label('Max Height', 'max_height', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'max_height',
                    'class' => 'form-field width60',
                    'value' => $upload['max_height'],
                    'title' => 'Maximum width for uploads set to 0 for unlimited'
                ));
                echo '</p><p>';
                echo form_label('Max Width', 'max_width', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'max_width',
                    'class' => 'form-field width60',
                    'value' => $upload['max_width'],
                    'title' => 'Maximum height for uploads set to 0 for unlimited'
                ));
                echo '</p><p>';
                echo form_label('Max File Size', 'max_size', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'max_size',
                    'class' => 'form-field width60',
                    'value' => $upload['max_size'],
                    'title' => 'Maximum filesize for uploads set to 0 for unlimited'
                ));
                echo '</p><p>';
                echo form_label('Max Filename', 'max_filename', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'max_filename',
                    'class' => 'form-field width60',
                    'value' => $upload['max_filename'],
                    'title' => 'Maximum length for uploads filename set to 0 for unlimited'
                ));
                echo '</p><p>';
                echo form_label('Encrypt Names', 'encrypt_name', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'encrypt_name',
                    'class' => 'form-field width60',
                    'value' => $upload['encrypt_name'],
                    'title' => 'Convert uploaded filenames to random string set to 0 to disable'
                ));
                echo '</p><p>';
                echo form_label('Remove Spaces', 'remove_space', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'remove_space',
                    'class' => 'form-field width60',
                    'value' => $upload['remove_spaces'],
                    'title' => 'Convert spaces from uploaded filenames to underscores set to 0 to disable'
                ));
                echo '</p>';
                echo form_submit(array('name' => 'upload', 'value' => $this->lang->line('g_submit'), 'class' => 'big button themed'));
                ?>
            </div>
            <div id="users">
                <?php
                $users = read_config('users');

                echo form_open('admin/settings', array('class' => 'form'));
                echo '<p>';
                echo form_label('', 'base_url', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'base_url2',
                    'class' => 'form-field width60',
                    'value' => $site['base_url'],
                    'title' => 'Url to your site'
                ));
                echo '</p><p>';
                echo form_label('Index Page', 'index', array('class' => 'form-label'));
                echo form_input(array(
                    'name' => 'index2',
                    'class' => 'form-field width60',
                    'value' => $site['index_page'],
                    'title' => 'index file name removed if using htaccess to clean urls'
                ));
                echo '</p>';

                echo form_submit(array('name' => 'users', 'value' => $this->lang->line('g_submit'), 'class' => 'big button themed'));
                ?>
            </div>
        </div>
    </div>
</div>